package com.fxf.srb.core.controller.admin;

import com.fxf.common.result.R;
import com.fxf.srb.core.pojo.entity.LendItem;
import com.fxf.srb.core.service.ILendItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 饭小范
 * @version 1.0
 * @description: TODO
 * @date 2021/6/6 22:44
 */
@Slf4j
@Api(tags = "标的投资")
@RestController
@RequestMapping("/admin/core/lendItem")
public class AdminLendItemController {

    @Resource
    private ILendItemService iLendItemService;

    @ApiOperation("获取列表")
    @GetMapping("/list/{lendId}")
    public R List(
            @ApiParam(value = "标的id",required = true)
            @PathVariable("lendId") Long lendId){

       List<LendItem> list = iLendItemService.selectByLendId(lendId);
       return R.ok().data("list",list);
    }
}
